package app.model.sys;

// Generated 2016-9-9 13:24:56 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * SysRole generated by hbm2java
 */
@Entity
@Table(name = "sys_role")
public class SysRole implements java.io.Serializable {

	private String id;
	private String roleName;
	private String remark;
	private Date createTime;
	private Integer isUse;
	
	private Set<SysUserRole> sysUserRole = new HashSet<SysUserRole>(); 

	public SysRole() {
	}

	public SysRole(String id, String roleName) {
		this.id = id;
		this.roleName = roleName;
	}

	public SysRole(String id, String roleName, String remark, Date createTime, Integer isUse) {
		this.id = id;
		this.roleName = roleName;
		this.remark = remark;
		this.createTime = createTime;
		this.isUse = isUse;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false, length = 40)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "role_name", nullable = false, length = 100)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@Column(name = "remark", length = 400)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "is_use")
	public Integer getIsUse() {
		return this.isUse;
	}

	public void setIsUse(Integer isUse) {
		this.isUse = isUse;
	}

	@OneToMany(cascade={CascadeType.REMOVE},mappedBy="sysUser")
	public Set<SysUserRole> getSysUserRole() {
		return sysUserRole;
	}

	public void setSysUserRole(Set<SysUserRole> sysUserRole) {
		this.sysUserRole = sysUserRole;
	}
}
